function DialogPublish(doc, container, width, height, user, date, options, data) {
  this._doc = doc;
  this._container = container;
  this._user = user;
  this._date = date;
  this._options = options;
  this._data = data;
  this._unique = MiscUtils.unique();
  this._publish = (options && options.pub) ? options.pub : false;
  this._createElements();
  this._gui = AbsDialogPublish.gui(this._unique);
  
};

DialogPublish.prototype._createElements = function() {
  var table, tr, td;
  
  table = document.createElement('table');
  table.cellPadding = 0;
  table.cellSpacing = 0;
  table.style.width = '460px';
  table.style.marginTop = '10px';
  this._container.appendChild(table);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.height = '25px';
  td.style.textAlign = 'left';
  td.style.width = '100px';
  td.style.fontWeight = 'bold';
  td.appendChild(document.createTextNode('Is Wedding'));
  
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.colSpan = 2;
  var dlinput = DOMUtils.createInput('', '', 'checkbox', '', null);
  dlinput.style.marginLeft= '0px';
  dlinput.id = this._unique + '_iswedding_checkbox';
  td.appendChild(dlinput);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.height = '25px';
  td.style.textAlign = 'left';
  td.style.width = '100px';
  td.style.fontWeight = 'bold';
  td.appendChild(document.createTextNode('Bride Name'));
  
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.colSpan = 2;
  var dlinput = DOMUtils.createInput('', '', 'text', '', null);
  dlinput.style.width = '250px';
  dlinput.id = this._unique + '_bname_text';
  td.appendChild(dlinput);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.height = '25px';
  td.style.textAlign = 'left';
  td.style.width = '100px';
  td.style.fontWeight = 'bold';
  td.appendChild(document.createTextNode('Groom Name'));
  
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.colSpan = 2;
  var dlinput = DOMUtils.createInput('', '', 'text', '', null);
  dlinput.style.width = '250px';
  dlinput.id = this._unique + '_gname_text';
  td.appendChild(dlinput);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.height = '25px';
  td.style.width = '130px';
  td.style.fontWeight = 'bold';
  td.style.whiteSpace = 'nowrap';
  td.appendChild(document.createTextNode('Culture1'));
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.width = '235px';
  var br = document.createElement("select");
  br.id = this._unique + '_culture1_select';
  br.style.width = '230px';
  br.style.height = '22px';
  td.appendChild(br);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  var add = document.createElement("input");
  add.id = this._unique + '_add_culture1';
  add.className = 'add2';
  add.type = 'button';
  td.appendChild(add);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.height = '25px';
  td.style.width = '100px';
  td.style.fontWeight = 'bold';
  td.style.whiteSpace = 'nowrap';
  td.appendChild(document.createTextNode('Culture2'));
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  var br = document.createElement("select");
  br.id = this._unique + '_culture2_select';
  br.style.width = '230px';
  br.style.height = '22px';
  td.appendChild(br);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  var add = document.createElement("input");
  add.id = this._unique + '_add_culture2';
  add.className = 'add2';
  add.type = 'button';
  td.appendChild(add);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.height = '25px';
  td.style.width = '100px';
  td.style.fontWeight = 'bold';
  td.style.whiteSpace = 'nowrap';
  td.appendChild(document.createTextNode('Ceremony'));
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  var br = document.createElement("select");
  br.id = this._unique + '_ceremony_select';
  br.style.width = '230px';
  br.style.height = '22px';
  td.appendChild(br);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  var add = document.createElement("input");
  add.id = this._unique + '_add_ceremony';
  add.className = 'add2';
  add.type = 'button';
  td.appendChild(add);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.height = '25px';
  td.style.width = '100px';
  td.style.fontWeight = 'bold';
  td.style.whiteSpace = 'nowrap';
  td.appendChild(document.createTextNode('Reception'));
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  var br = document.createElement("select");
  br.id = this._unique + '_reception_select';
  br.style.width = '230px';
  br.style.height = '22px';
  td.appendChild(br);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  var add = document.createElement("input");
  add.id = this._unique + '_add_reception';
  add.className = 'add2';
  add.type = 'button';
  td.appendChild(add);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.height = '25px';
  td.style.width = '100px';
  td.style.fontWeight = 'bold';
  td.style.whiteSpace = 'nowrap';
  td.appendChild(document.createTextNode('Wedding Color'));
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  var br = document.createElement("select");
  br.id = this._unique + '_weddingcolor_select';
  br.style.width = '230px';
  br.style.height = '22px';
  td.appendChild(br);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  var add = document.createElement("input");
  add.id = this._unique + '_add_color';
  add.className = 'add2';
  add.type = 'button';
  td.appendChild(add);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.height = '25px';
  td.style.textAlign = 'left';
  td.style.width = '100px';
  td.style.fontWeight = 'bold';
  td.appendChild(document.createTextNode('Photographer'));
  
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.colSpan = 2;
  var input2 = document.createElement("select");
  input2.id = this._unique + '_photographer_select';
  input2.style.width = '255px';
  input2.style.height = '22px';
  td.appendChild(input2);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.height = '25px';
  td.style.width = '100px';
  td.style.fontWeight = 'bold';
  td.appendChild(document.createTextNode('2nd Photographer'));
  
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.colSpan = 2;
  var input2 = document.createElement("select");
  input2.id = this._unique + '_photographer2_select';
  input2.style.width = '255px';
  input2.style.height = '22px';
  td.appendChild(input2);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.width = '100px';
  td.style.height = '25px';
  td.style.fontWeight = 'bold';
  td.appendChild(document.createTextNode('Designer'));
  
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.colSpan = 2;
  var input2 = document.createElement("select");
  input2.id = this._unique + '_designer_select';
  input2.style.width = '255px';
  input2.style.height = '22px';
  td.appendChild(input2);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.width = '100px';
  td.style.height = '25px';
  td.style.fontWeight = 'bold';
  td.appendChild(document.createTextNode('Photographer Score'));
  td = tr.insertCell(-1);
  td.colSpan = 2;
  td.id = this._unique + '_score_div';
  
  tr = table.insertRow(-1);
  tr.id = this._unique + '_photo2_div';
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.width = '100px';
  td.style.height = '25px';
  td.style.fontWeight = 'bold';
  td.appendChild(document.createTextNode('2nd Photographer Score'));
  td = tr.insertCell(-1);
  td.colSpan = 2;
  td.id = this._unique + '_score2_div';
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.width = '100px';
  td.style.height = '25px';
  td.style.fontWeight = 'bold';
  td.appendChild(document.createTextNode('asst修片'));
  td = tr.insertCell(-1);
  td.colSpan = 2;
  td.id = this._unique + '_asstretouch_div';
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.width = '100px';
  td.style.height = '25px';
  td.style.fontWeight = 'bold';
  td.appendChild(document.createTextNode('admin修片'));
  td = tr.insertCell(-1);
  td.colSpan = 2;
  td.id = this._unique + '_adminretouch_div';
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.colSpan=4;
  var ltable = document.createElement('table');
  ltable.style.margin = '18px 0 0 0';
  ltable.cellPadding = 0;
  ltable.cellSpacing = 0;
  ltable.style.width = '460px';
  ltable.className = "tableborder";
  ltable.id = this._unique + '_note_table';
  td.appendChild(ltable);
  
  ltr = ltable.insertRow(-1);
  ltr.style.backgroundColor = '#ddd';
  td = ltr.insertCell(-1);
  td.style.height = '23px';
  td.style.textAlign = 'left';
  td.style.width = '70px'
  td.style.padding = '0 0 0 5px';
  td.style.fontWeight = 'bold';
  td.appendChild(document.createTextNode('Date'));
  td = ltr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.padding = '0 0 0 5px';
  td.style.width = '85px';
  td.style.fontWeight = 'bold';
  td.appendChild(document.createTextNode('User'));
  td = ltr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.width = '270px';
  var ctable = document.createElement('table');
  ctable.style.width = '100%';
  ctable.cellPadding = 0;
  ctable.cellSpacing = 0;
  td.appendChild(ctable);
  
  ctr = ctable.insertRow(-1);
  td = ctr.insertCell(-1);
  td.style.textAlign = 'left';
  td.style.width = '245px';
  td.style.padding = '0 0 0 5px';
  td.style.fontWeight = 'bold';
  td.style.border = 0;
  td.style.height = '23px';
  td.appendChild(document.createTextNode('Content'));
  td = ltr.insertCell(-1);
  td.style.width = '25px';
  
  td = ctr.insertCell(-1);
  td.style.textAlign = 'center';
  td.style.width = '25px';
  td.style.border = 0;  
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.height = '35px';
  td.style.textAlign = 'center';
  td.style.verticalAlign = 'bottom';
  td.colSpan=4;
  var add = DOMUtils.createInput('', '', 'button', 'OK', null);
  add.className = "button";
  add.id = this._unique + '_ok_button';
  td.appendChild(add);
  var add = DOMUtils.createInput('', '', 'button', 'Add Note', null);
  add.className = "button";
  add.id = this._unique + '_add_button';
  td.appendChild(add);
  var cancel = DOMUtils.createInput('', '', 'button', 'Cancel', null);
  cancel.className = "button";
  cancel.id = this._unique + '_close_button';
  td.appendChild(cancel);
};